<!DOCTYPE html>
<html lang="en" xmlns:th=http://www.thymeleaf.org>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet"  th:href="@{/static/layui/css/layui.css}"  media="all">
</head>
<body>
<h2>增加数据字典类型</h2>
<form class="layui-form layui-form-pane">
    <div class="layui-form-item">
        <label class="layui-form-label">字典类型名称</label>
        <div class="layui-input-block">
            <input type="text" name="typeName" lay-verify="required" lay-reqtext="用户名是必填项，岂能为空？" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">字典类型编码</label>
        <div class="layui-input-block">
            <input type="text" name="typeCoding" lay-verify="required" lay-reqtext="用户名是必填项，岂能为空？" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">序列号</label>
        <div class="layui-input-block">
            <input type="text" name="orderNumber" lay-verify="required" lay-reqtext="用户名是必填项，岂能为空？" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" pane>
        <label class="layui-form-label">字典状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="0" title="激活" checked>
            <input type="radio" name="status" value="1" title="停用">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
<script th:src="@{/static/bootstrap/jquery/jquery-3.3.1.min.js}"></script>
<script th:src="@{/static/layui/layui.js}"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function() { //独立版的layer无需执行这一句
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate; //独立版的layer无需执行这一句

        //监听提交
        form.on('submit(demo1)', function(data){
            console.log(data);
            var json = data.field;
            var temp = JSON.stringify(json);
            $.ajax({
                url:"/activiti-data-dictionary/addDataType",
                type:"POST",
                data:temp,
                contentType:"application/json",
                dataType: "json",
                success:function(res){
                    alert(res.message);
                }
            });
            return false;
        });
    });
</script>

</html>